[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
& Unary Address operator; Bitwise Binary AND operator
&lvalue Address of lvalue (used as unary address operator)
or
exp1 & exp2 Bitwise AND operator (used as binary AND operator)
The & operator has two different meanings, depending upon its
context.
When used as a unary operator, & returns the address of a variable or
function. This value can then be assigned to any pointer; you may
need to use a type-cast if the pointer you're assigning the address
to has a different type than lvalue. Here are two examples using &
as a unary address operator:
myptr = &i;
myfncptr = &myfunc;
When used as a binary operator, & performs a bit-by-bit AND operation
on exp1 and exp2. For example:
i = 0x0FF0;
j = 0xFF00;
k = i & j; /* k == 0x0F00 */
See Also:
*
^^
|
~
&&
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson